<table width="500" border="0">
    <tr>
        <td width="5%"><b>Artikel-Nr</b></td>
        <td width="50%"><b>Omschrijving</b></td>
        <td width="15%"><b>Bedrag</b></td>
        <td width="7%"><b>Info</b></td>
        <td width="20%"><b>Datum</b></td>
    </tr>
    <tr>
        <td colspan="5"><hr size="1" width="100%"></td>
    </tr>
    <?
	$totaalprijs=0;
    $result = mysql_query("SELECT * FROM sessie WHERE ip = '".$_SERVER['REMOTE_ADDR']."'");
    if($result)
    {
        $row = mysql_fetch_array($result);
        $result2 = mysql_query("SELECT * FROM winkelwagen WHERE idklant = '".$row['idklant']."' AND betaald = '1'");
        if($result2)
        {
            while($numresults=mysql_fetch_array($result2))
            {
                $qry = mysql_query("SELECT * FROM artikelen WHERE id = '".$numresults['artikelid']."'"); 
				$ary = mysql_fetch_array($qry);
				$totaalprijs+=$ary['bedrag'];
                ?>
                <tr>
                    <td><? print $ary['id']; ?></td>
                    <td><? print $ary['omschrijving']; ?></td>
                    <td>&euro;<? print $ary['bedrag']; ?></td>
                    <td><a href="index.php?page=article&id=<? print $ary['id']; ?>"> details </a></td>
                    <td><? print $numresults['date']; ?></td>
                </tr>
                <?
            }
        }
    }
	
	if($totaalprijs>0)
	{
		?>
    	<tr>
    		<td>&nbsp;</td>
    		<td>&nbsp;</td>
    		<td>&euro;<? print $totaalprijs; ?></td>
    		<td>&nbsp;</td>
    		<td>&nbsp;</td>
    	</tr>
        <?
	}
	?>
</table>